import type { MenuProps } from 'antd';
import { Button, Dropdown, Space } from 'antd';
import React from 'react';
import { Link } from 'umi';
type Props = {
    txt: any
}

function New({ txt }: Props) {
    const items: MenuProps['items'] = [
        {
            key: '1',
            label: (
                <Link to="/new/amEditor"> 新建文章-协同编辑器</Link>
            ),
        },
        {
            key: '2',
            label: (
                <Link to="/new/editor">新建文章</Link>
            ),
        },
        {
            key: '3',
            label: (
                <Link to="/new/page">新建页面</Link>
            ),
        },
    ];
    const Ds = () => {
        if (!txt) {
            return <> 新建</>
        }
        else {
            return <></>
        }
    }
    return (
        <div>
            <Space direction="vertical">
                <Space wrap>
                    <Dropdown menu={{ items }} placement="bottom">
                        <Button className='xj'>+ <Ds /></Button>
                    </Dropdown>
                </Space>
            </Space>
        </div>
    )
}

export default New